package cn.com.sinux.spring.utils.fileconvert;

import com.artofsolving.jodconverter.DefaultDocumentFormatRegistry;
import com.artofsolving.jodconverter.DocumentFormat;

import java.util.Collections;
import java.util.List;

/**
 * Created by Administrator on 2014/7/10.
 */
public class ConvertObject {


    private String source;
    private List<String> results;
    private ConvertEngine.ConvertStatus convertStatus;
    private String desDir;
    private String error;


    public ConvertObject(String source, String desDir) {
        this.source = source;
        this.desDir = desDir;
    }

    public void success(List<String> results){
        this.results = results;
        this.convertStatus = ConvertEngine.ConvertStatus.SUCCESS;
    }

    public void success(String result){
        this.results = Collections.singletonList(result);
        this.convertStatus = ConvertEngine.ConvertStatus.SUCCESS;
    }

    public void failure(String eror){
        this.error = eror;
        this.convertStatus = ConvertEngine.ConvertStatus.FAILURE;
    }

    public String getSource() {
        return source;
    }

    public List<String> getResults() {
        return results;
    }

    public ConvertEngine.ConvertStatus getConvertStatus() {
        return convertStatus;
    }

    public String getDesDir() {
        return desDir;
    }

    public String getError() {
        return error;
    }
}
